package com.dfbz.demo03_泛型类的继承;

import com.dfbz.demo01_泛型的好处.Book;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01 {
    public static void main(String[] args) {

//        Zi zi = new Zi();

//        Zi2 zi2=new Zi2();
//        zi2.show(new Book("《西游记》","吴承恩"));

        Zi3 zi3=new Zi3();
        zi3.show(new Book("《说岳全传》","钱彩"));
    }
}

class Fu<E> {
    public void show(E e) {
        System.out.println(e.toString());
    }
}

// 父类默认的泛型就是Object
class Zi extends Fu {

}

// 在继承的时候明确泛型类型
class Zi2 extends Fu<Book>{

}

// 连同泛型一起继承下来,子类也变成泛型类
class Zi3<E> extends Fu<E>{

}